home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / DEM / S-Z / Special Delivery™ Demo.cpt / Special Delivery™ Demo / Claris / Claris Translators / EPSF.rsrc / PS_206 < prev    next >
Text File  |  1991-06-19  |  5KB  |  263 lines

  1. /StripFromFront { 
  2. dup length
  3. 2 index sub
  4. 3 1 roll
  5. exch 3 -1 roll
  6. getinterval
  7. } bind def
  8. /MakePathArray { 
  9.  /k 0 def 
  10.  {/k k 1 add def pop pop}{/k k 1 add def pop pop}{/k k 1 add def pop pop pop pop pop pop}{/k k 1 add def }pathforall 
  11.  k array
  12.  /k 0 def 
  13.  {{moveto} 3 array astore 1 index k 3 -1 roll put /k k 1 add def} 
  14.  {{lineto} 3 array astore 1 index k 3 -1 roll put /k k 1 add def} 
  15.  {{curveto} 7 array astore 1 index k 3 -1 roll put /k k 1 add def} 
  16.  {{closepath} 1 array astore 1 index k 3 -1 roll put /k k 1 add def} 
  17. pathforall 
  18. }bind def 
  19. /MakeFlatPathArray { 
  20. /k 0 def 
  21. {/k k 1 add def pop pop}{/k k 1 add def pop pop}{pop pop pop pop pop pop}{}pathforall 
  22. k array
  23. /k 0 def 
  24. {{moveto} 3 array astore 1 index k 3 -1 roll put /k k 1 add def} 
  25. {{lineto} 3 array astore 1 index k 3 -1 roll put /k k 1 add def} 
  26. { pop pop pop pop pop pop} 
  27. {} 
  28. pathforall 
  29. }bind def 
  30. /FractionalLine {
  31. 2 index sub
  32. .00001 mul
  33. exch
  34. 3 index sub
  35. .00001 mul
  36. 4 -1 roll add
  37. 3 1 roll
  38. add
  39. } bind def
  40. /calcLineLength {
  41.  exch
  42.  4 -1 roll
  43.  sub
  44.  dup mul
  45.  3 1 roll exch
  46.  sub
  47.  dup mul
  48.  add sqrt
  49. } bind def
  50. /InitTotalLineLength {
  51.  /oldY exch def
  52.  /oldX exch def
  53.  theDash aload pop currentLineLength add setdash
  54. } bind def
  55. /AccumeLineLength {
  56.  3 copy pop
  57.  2 copy
  58.  oldX oldY
  59.  4 2 roll calcLineLength
  60.  /segmentLength exch def
  61.  /currentLineLength currentLineLength segmentLength add def
  62.  /oldY exch def
  63.  /oldX exch def
  64. } bind def
  65. /DecumeLastLineLength {
  66.  /currentLineLength currentLineLength segmentLength sub def
  67. } bind def
  68. /DrawFlattendSegment {
  69.  /pointCount 2 def
  70.  dup 0 lt { pop 0 } if
  71.  fpc
  72.  3 1 roll
  73.  2 index
  74.  1 index
  75.  gt {
  76.  2 copy get
  77.  dup length
  78.  dup 3 eq {
  79.  pop
  80.  dup 0 get
  81.  exch 1 get
  82.  2 copy InitTotalLineLength  
  83.  m
  84.  } {
  85.  } ifelse
  86.  } {
  87.  pop 1 index
  88.  } ifelse
  89.  dup 1 add
  90.  3 index
  91.  exch sub
  92.  dup 10 gt { pop 10} if
  93.  {
  94.  1 add
  95.  2 copy
  96.  get aload pop
  97.  AccumeLineLength
  98.  exec
  99.  } repeat
  100.  3 1 roll pop pop
  101.  DecumeLastLineLength
  102. } bind def
  103. /IncFPC {
  104.  fpc add
  105.  /fpc exch def
  106. } bind def
  107. /DrawFlatPathArray {
  108.  fpc
  109.  0 { 
  110.  dup 2 index
  111.  1 sub
  112.  lt { 
  113.  flatPathArray exch
  114.  newpath
  115.  1 sub DrawFlattendSegment
  116.  gsave
  117.  pathSegProc
  118.  grestore
  119.  newpath
  120.  }
  121.  {
  122.  pop pop
  123.  exit
  124.  } ifelse
  125.  } loop
  126. } bind def
  127. /RecordFirstSubSegment {
  128.  closepathArray 0 pathArray 0 get
  129.  put
  130.  closepathArray 1
  131.  pathArray 0 get aload pop pop
  132.  pathArray 1 get dup length 3 eq {
  133.  aload pop pop
  134.  } {
  135.  newpath
  136.  0 0 moveto
  137.  aload pop exec
  138.  /segmentArray flattenpath MakeFlatPathArray def
  139.  segmentArray 1 get aload pop pop
  140.  } ifelse
  141.  FractionalLine {lineto} 3 array astore
  142.  put
  143. } bind def
  144. /AppendClosePath {
  145.  closepathArray 0 get 2 {lineto} put
  146.  flatPathArray fpc closepathArray 0 get put
  147.  1 IncFPC
  148.  flatPathArray fpc closepathArray 1 get put
  149.  1 IncFPC
  150. } bind def
  151. /RecordCurrentDash {
  152.  /theDash
  153.  currentdash 2 array astore def
  154.  /currentLineLength 0 def
  155. } bind def
  156. /PatternStroke {
  157.     0 setlinecap
  158.  RecordCurrentDash
  159.  /saveFlat currentflat def
  160.  .5 setflat
  161.  /pathArray MakePathArray def
  162.  /closepathArray 2 array def
  163.  /pathLength pathArray length def
  164.  /flatPathArray 513 array def
  165.  /currentLineLength 0 def
  166.  /fpc 0 def
  167.  pathArray pathLength 1 sub get
  168.  length 1 eq {
  169.  /usingClosepath true def
  170.  RecordFirstSubSegment
  171.  /pathLength pathLength 1 sub def
  172.  } {
  173.  /usingClosepath false def
  174.  } ifelse
  175.  0 1 pathLength 1 sub {
  176.  pathArray exch get
  177.  dup length 3 eq {
  178.  fpc 1 add 512 ge {
  179.  DrawFlatPathArray
  180.  fpc 2 ge {
  181.  flatPathArray flatPathArray fpc 2 sub get 0 put
  182.  flatPathArray flatPathArray fpc 1 sub get 1 put
  183.  /fpc 2 def
  184.  }{
  185.  /fpc 0 def
  186.  } ifelse
  187.  } if
  188.  flatPathArray exch fpc exch put
  189.  1 IncFPC
  190.  } {
  191.  dup length 7 eq {
  192.  newpath
  193.  /nToStrip 0 def
  194.  fpc 1 gt {
  195.  flatPathArray fpc 2 sub get aload pop pop m
  196.  flatPathArray fpc 1 sub get aload pop exec
  197.  /nToStrip 2 def
  198.  } {
  199.  fpc 1 eq {
  200.  flatPathArray fpc 1 sub get aload pop exec
  201.  /nToStrip 2 def
  202.  } if
  203.  } ifelse
  204.  aload pop exec
  205.  /segmentArray flattenpath MakeFlatPathArray def
  206.  /segmentArray nToStrip segmentArray StripFromFront def
  207.  segmentArray length fpc add 512 lt {
  208.  flatPathArray fpc segmentArray putinterval
  209.  segmentArray length IncFPC
  210.  } {
  211.  DrawFlatPathArray
  212.  fpc 1 gt {
  213.  flatPathArray flatPathArray fpc 2 sub get 0 exch put
  214.  flatPathArray flatPathArray fpc 1 sub get 1 exch put
  215.  /fpc 2 def
  216.  }{
  217.  /fpc 0 def
  218.  } ifelse
  219.  segmentArray length 512 lt {
  220.  flatPathArray fpc segmentArray putinterval
  221.  segmentArray length IncFPC
  222.  } {
  223.  segmentArray length
  224.  /exitLoop false def
  225.  0 
  226.  {
  227.  2 copy sub
  228.  dup 500 gt {
  229.  pop 500
  230.  } { 
  231.  /exitLoop true def
  232.  } ifelse 
  233.  segmentArray 2 index 2 index getinterval
  234.  flatPathArray fpc 3 -1 roll putinterval
  235.  dup IncFPC
  236.  add 
  237.  exitLoop {
  238.  exit 
  239.  } {
  240.  DrawFlatPathArray
  241.  fpc 1 gt {
  242.  flatPathArray flatPathArray fpc 2 sub get 0 exch put
  243.  flatPathArray flatPathArray fpc 1 sub get 1 exch put
  244.  /fpc 2 def
  245.  }{
  246.  /fpc 0 def
  247.  } ifelse
  248.  } ifelse
  249.  } loop
  250.  } ifelse
  251.  } ifelse
  252.  } if
  253.  } ifelse
  254.  } for
  255.  fpc 0 gt {
  256.  usingClosepath {
  257.  AppendClosePath
  258.  } if
  259.  DrawFlatPathArray
  260.  } if
  261.  saveFlat setflat
  262. } bind def